<template>
  <div>
    <div>
      <!-- 页头 -->
      <!-- <div class="back">
        <span style="font-size: 20px; font-weight: 500; color: #2f343e"
          >知识情报索引</span
        >
      </div> -->
      <!-- 主题 -->
      <div class="content-box">
        <div
          style="
            display: flex;
            justify-content: center;
            flex-direction: column;
           margin-left:280px
          "
        >
          <div class="img-box">
            <img src="@/assets/images/bianji9@3x.png" alt="" />
          </div>
          <div
            style="
              font-size: 24px;
              color: #000000;
              font-weight: 500;
              margin-top: 18px;
              margin-bottom: 81px;
            "
          >
            知识情报检索
          </div>
        </div>
        <!-- 头部tab栏切换 -->
        <div class="data-tabs">
          <div
            class="data-tabs-btn"
            :class="{ selected: isActive == index }"
            v-for="(item, index) in tabs"
            :key="index"
            @click="
              isActive = index;
              componentId = item.componentId;
            "
          >
            {{ item.title }}
          </div>
          <!-- 头部tab栏切换内容 -->
        </div>
        <!-- 搜索组 -->
        <div class="search-input">
          <el-input
            v-model="input_value"
            placeholder="请输入关键词"
            class="input-with-select"
            @keyup.enter.native="showTrue(input_value)"
          >
            <el-button slot="append" icon="el-icon-search" @click="showTrue(input_value)">搜索 </el-button>
          </el-input>
        </div>
          <!-- tab切换主题 -->
    <div style="margin-bottom:140px">
      <keep-alive>
        <component :is="componentId"></component>
      </keep-alive>
    </div>
      </div>
    </div>
  </div>
</template>
<script>
import HkTable from "@/components/HKTable";
import ReportBtn from "./component/ReportBtn.vue"
import InsertBtn from "./component/InsertBtn.vue"
export default {
  components: { HkTable,ReportBtn,InsertBtn },
  data() {
    return {
      input_value:"",
      // tab栏切换
      tabs: [
        {
          title: "业务监管",
          componentId: "InsertBtn",
        },
        {
          title: "网络威胁情报",
          componentId: "ReportBtn",
        },
      ],
      isActive: 0,
      componentId: "InsertBtn",
    };
  },
};
</script>

<style scoped lang="scss">
.back {
  margin-bottom: 20px;
}
.content-box {
  background-color: #ffffff;
  //   height: 1000px;
  padding-top: 120px;
  padding-bottom: 43px;
  padding-left: 30%;
  // margin: auto;
  .img-box {
    width: 100px;
    height: 100px;
    margin-left: 20px;
    img {
      width: 100%;
      height: 100%;
    }
  }
//   tab切换
  .data-tabs {
    display: flex;
    align-items: center;
    // justify-content: center;
    // margin-bottom: 20px;
    
    .data-tabs-btn {
      width: 110px;
      height: 32px;
      line-height: 32px;
      text-align: center;
      margin-right: 10px;
      margin-bottom: 8px;
      border: 1px solid rgba(0, 0, 0, 0.15);
      border-radius: 4px;
      cursor: pointer;
      font-size: 14px;
    }
  }
  .selected {
   background: #4B6EEF;
border: 1px solid rgba(75,110,239,1);
border-radius: 4px;
font-size: 14px;
color: #FFFFFF;
  }
   // 搜索区域
  .search-input {
    width: 700px;
    // margin: 0 auto;
    margin-bottom: 38px;
    .btn-group {
      position: relative;
      z-index: 2;
      .btn {
        display: inline-block;
        padding: 9px 0;
        width: 100px;
        height: 48px;
        background: #ffffff;
        border: 1px solid rgba(229, 229, 229, 1);
        border-radius: 4px;
        text-align: center;
        font-size: 16px;
        cursor: pointer;

        &:nth-of-type(2) {
          margin: 0 10px;
        }

        &.active {
          border-color: #4b6eef;
          color: #ffffff;
          background-color: #4b6eef;
        }
      }
    }

    .el-input {
      width: 700px;
      outline: none;
      margin-top: 10px;
      &::v-deep .el-input-group__prepend {
        width: 100px !important;
      }
      &::v-deep .el-input__inner {
        border-color: #c8cbcd;
        height: 48px;
        border-top-right-radius: 0px !important;
        border-bottom-right-radius: 0px !important;
      }

      &::v-deep .el-input-group__append {
        border: 0;
      }

      &::v-deep .el-button {
        height: 48px;
        color: #fff;
        background: #4b6eef;
        border-radius: 0px;
        border-top-right-radius: 4px;
        border-bottom-right-radius: 4px;
      }
    }
  }
}
</style>
